import request from '@/utils/request'

// 查询残次品列表
export function listDefect(query) {
  return request({
    url: '/store/defect/list',
    method: 'get',
    params: query
  })
}

// 查询残次品详细
export function getDefect(productCode) {
  return request({
    url: '/store/defect/' + productCode,
    method: 'get'
  })
}

// 新增残次品
export function addDefect(data) {
  return request({
    url: '/store/defect',
    method: 'post',
    data: data
  })
}

// 修改残次品
export function updateDefect(data) {
  return request({
    url: '/store/defect',
    method: 'put',
    data: data
  })
}

// 删除残次品
export function delDefect(productCode) {
  return request({
    url: '/store/defect/' + productCode,
    method: 'delete'
  })
}
